#include "sortdialog.h"
#include "ui_sortdialog.h"
#include <QComboBox>
SortDialog::SortDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SortDialog)
{
    ui->setupUi(this);
    ui->SecondaryGroupBox->hide();
    ui->TertairyGroupBox->hide();
    this->layout()->setSizeConstraint(QLayout::SetFixedSize);
    setColumnRange('A','F');
}

SortDialog::~SortDialog()
{
    delete ui;
}
void SortDialog::setColumnRange(QChar first, QChar last)
{
    ui->primaryColumnCombo->clear();
    ui->secondaryColumnCombo->clear();
    ui->tertairyColumnCombo->clear();

    ui->secondaryColumnCombo->addItem(tr("None"));
    QChar ch=first;
    while(ch<=last){
        ui->primaryColumnCombo->addItem(QString(ch));
        ui->secondaryColumnCombo->addItem(QString(ch));
        ui->tertairyColumnCombo->addItem(QString(ch));
        ch=ch.unicode()+1;
    }
}
QComboBox* SortDialog::getPrimaryColumnCombo()const
{
    return ui->primaryColumnCombo;
}
QComboBox* SortDialog::getPrimaryOrderCombo()const
{
    return ui->firstOrderComboBox;
}

QComboBox* SortDialog::getSecondaryColumnCombo()const
{
    return ui->secondaryColumnCombo;
}
QComboBox* SortDialog::getSecondaryOrderCombo()const
{
    return ui->secondOrderComboBox;
}

QComboBox* SortDialog::getTertiaryColumnCombo()const
{
    return ui->tertairyColumnCombo;
}
QComboBox* SortDialog::getTertiaryOrderCombo()const
{
    return ui->thirdOrderComboBox;
}
